{include file="zp_includetop" /}
<title>留言- {$sitename}</title>
<meta name="keywords" content="{notempty name="list_keywords"}{$list_keywords}{else/}最新{$list_name},{$keywords}{/notempty}">
<meta name="description" content="{notempty name="list_description"}{$list_description}{else/}{$description}{/notempty}">
{include file="zp_include" /}
<link rel="stylesheet" href="{$apicss}skin/css/vod.css" />
<style>
.gb-left {
    float: left;
    width: 832px;
    overflow: hidden;
}

.gb-show-list {
    overflow: hidden;
    padding: 10px 0;
}

.gb-show-l {
    width: 70px;
    height: 70px;
    text-align: center;
    font-size: 12px;
    color: #E35000;
    line-height: 20px;
    overflow: hidden;
    float: left;
    border-radius: 5px;
    background-image: url({$apicss}skin/images/artimgbg.gif);
    background-repeat: no-repeat;
    background-position: 0 0;
}

.gb-show-l img {
    width: 70px;
    height: 70px;
}

.gb-number {
    display: block;
    margin-top: 10px;
    font-weight: bold;
    font-family: Comic Sans MS;
}

.gb-show-r {
    float: right;
    width: 742px;
    z-index: 1;
    position: relative;
}

.gb-arrow {
    width: 10px;
    height: 15px;
    overflow: hidden;
    margin-top: 17px;
    float: left;
    position: absolute;
    background: url({$apicss}skin/images/comment-arrow.gif) 0 0 no-repeat;
    left: -10px;
    top: -3px;
}

.gb-arrow-t {
    width: 17px;
    height: 10px;
    overflow: hidden;
    position: absolute;
    background: url({$apicss}skin/images/comment-arrow.gif) -10px 0 no-repeat;
    top: -9px;
    left: 20px;
    z-index: 999;
}

.gb-cont {
    overflow: hidden;
    margin-left: -1px;
    border: 1px solid #e3e3e3;
    background: #f9f9f9;
    border-radius: 4px;
    min-height: 70px;
}

.gb-admin-tab {
    overflow: hidden;
    border: 1px solid #e3e3e3;
    background: #fff;
    border-radius: 2px;
    margin-top: -1px
}

.gb-admin {
    position: relative;
    min-height: 70px;
    width: 95%;
    margin: 20px auto;
}

.gb-title,.gb-admin-title {
    height: 35px;
    line-height: 35px;
    padding: 0px 10px;
    border-bottom: 1px dotted #e3e3e3
}

.gb-admin-title h3 {
    float: left;
    color: #829225
}

.gb-title h3 {
    float: left;
}

.gb-title h3 a {
    color: #E35000
}

.gb-title span,.gb-admin-title span {
    float: right
}

.gb-txt {
    padding: 5px 10px;
    line-height: 35px;
    font-size: 14px;
}

.gb-right {
    width: 348px;
    overflow: hidden;
    padding: 0 0 10px 0;
    background: #E9E9E9;
    border: 1px solid #fff;
    border-top: none;
    float: right;
	margin-top: 10px;
    background-image: url({$apicss}skin/images/gbimgtitle.gif);
    background-repeat: no-repeat;
}

.gb-right-title {
    font-size: 26px;
    font-weight: bold;
    height: 30px;
    padding-top: 10px;
    padding-right: 15px;
    padding-bottom: 10px;
    padding-left: 15px;
}

.gb-right-item {
    width: 320px;
    padding: 14px 14px 5px 14px;
    overflow: hidden;
}

.gb-right .ui-label {
    display: block;
    line-height: 30px;
    font-size: 14px;
}

.gb-right .ui-input {
    width: 300px;
    float: left;
    clear: both;
    padding: 5px 8px;
    height: 22px;
    overflow: hidden;
    color: #E35000;
    border: 1px solid #e3e3e3;
    border-radius: 1px;
    background-color: #fff;
}

.gb-right .vcodde {
    line-height: 28px
}

.gb-right .vcode {
    float: left
}

.gb-right .ui-code {
    float: left;
    width: 50px;
    float: left;
    padding: 2px 8px;
    height: 22px;
    overflow: hidden;
    color: #E35000;
    border: 1px solid #e3e3e3;
    border-radius: 1px;
    background-color: #fff;
}

#gb_types li {
    width: 75px;
    height: 30px;
    line-height: 28px;
    overflow: hidden;
    float: left;
    text-align: center;
    cursor: pointer;
    margin: 0 3px 0 0;
    border: 1px solid #fff;
    border-radius: 3px;
    background-color: #333;
    color: #FFF;
    text-shadow: none
}

#gb_types li.selected {
    color: #fff;
    border: 1px solid #fff;
    background: #E35000;
}

.gb-right-type-msg {
    color: #E35000;
    width: 228px;
    padding: 5px 10px;
    margin: 0 14px;
    border-radius: 5px;
    border: 1px solid #E35000;
    background: #ffc;
    display: none
}

.gb_content {
    border: 1px solid #e3e3e3;
    background-color: #fff;
    padding: 5px 10px;
    width: 298px;
    font-size: 14px;
    line-height: 24px;
    color: #9c9c9c;
    height: 150px;
    overflow: hidden;
}

.gb-right .ui-button {
    padding: 0 10px;
    float: right;
    height: 34px;
    line-height: 32px;
    overflow: hidden;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    color: #fff;
    border: 1px solid #fff;
    background: #E35000;
    border-radius: 1px;
}
</style>
</head>
<body>
{include file="zp_header" /}
<div class="wp clearfix">
	<div class="d-position"><a href="{$siteurl}" title="{$sitename}">首页</a><span>/</span>网站留言</div>
{php}$gb_list=zanpian_mysql_gb('limit:'.$userconfig['user_gbnum'].';page:true;order:gb_addtime desc');{/php}
<div class="gb-left" id="contents">
{notempty name="gb_list"}
{volist name="gb_list" id="zanpian"}
{php}$lou=$gb_list[0]['page']['pagecount']-(($page-1) * $userconfig['user_gbnum'] + $key);{/php}	
<!-- gb-show-list -->
<div class="gb-show-list">
<div class="gb-show-l">{empty name="zanpian.userid"}<span class="gb-number">{$lou}</span>条留言{else/}<a href="{$zanpian.user_homeurl}" target="_blank"><img src="{$zanpian.user_imageurl.small}" title="{$zanpian.gb_nickname}"/></a>{/empty}</div>
<div class="gb-show-r">
<div class="gb-cont">
<div class="gb-arrow"></div>
<div class="gb-title"><h3>{empty name="zanpian.userid"}游客:{$zanpian.gb_nickname}{else/}<a href="{$zanpian.user_homeurl}">{$zanpian.gb_nickname}</a>{/empty}</h3><span>{$zanpian.gb_addtime|date='Y-m-d H:i:s',###}</span></div>
<div class="gb-txt">{$zanpian.gb_content|htmlspecialchars|remove_xss}</div>
{notempty name="zanpian.gb_intro"}
<!-- gb-admin -->
<div class="gb-admin">
<div class="gb-admin-tab">
<div class="gb-arrow-t"></div>
<div class="gb-admin-title"><h3>管理员回复</h3></div>
<div class="gb-txt">{$zanpian.gb_intro}</div>
</div>
</div>
<!-- gb-admin -->
{/notempty}
</div>
</div>
</div>
<!-- gb-show-list -->
 {/volist}
 {else/}
<div class="kong">抱歉，没有相关留言！</div>
 {/notempty}
{notempty name="gb_list"}
<div class="uipages pages" id="long-page"><ul class="pagination"><span class="total">共{$gb_list.0.page.pagecount}条留言&nbsp;页次:{$gb_list.0.page.currentpage}/{$gb_list.0.page.totalpage}页</span>{$gb_list.0.page.pageurl}</ul>
</div>
{/notempty}
</div>
<div class="gb-right">
<form method="post" name="guestbook" id="guestbook">
					<div class="gb-right-title"></div>
                  <input name="gb_vid" type="hidden" id="gb_vid" value="{$vod_id|default=0}"/>
                  {empty name="userid"}
					<div class="gb-right-item">
						<label class="ui-label">请输入您的昵称：</label>
                         <input class="ui-input"  name="gb_nickname" id="gb_nickname" type="text" value="{empty name="userid"}请输入昵称！{else/}{$nickname}{/empty}" {notempty name="userid"}readonly="readonly"{/notempty}/>
					</div>
                    {/empty}
					<div class="gb-right-item">
						<label class="ui-label">选择类型：</label>
						<ul id="gb_types">
							<li {notempty name="vod_id"}class="selected"{/notempty} val="2">报错</li>
							<li val="3">故障</li>
							<li val="4">建议</li>
							<li {empty name="vod_id"}class="selected"{/empty} val="1">其他</li>	
						</ul>
                       <input type="hidden" name="gb_cid" id="gb_type" value="{notempty name="vod_id"}2{else/}1{/notempty}">
					</div>
					<div class="gb-right-item gb-right-type-msg">
						<p>请选择留言类型！</p>
					</div>
                    
					<div class="gb-right-item" style="padding-bottom:5px;">
						<label class="ui-label">请输入您的留言内容：</label>
						<textarea name="gb_content" id="gb_content" rows="6" cols="50" class="gb_content">{$gb_content|default='请留下您的宝贵意见，最多200个字。'}</textarea>
					</div>

           
					 <div class="gb-right-item" style="padding-top:5px;">	
                      <div class="vcodde">
                     {notempty name="userconfig['user_code']"}
          <div class="vcode">验证码：</div><input class="ui-code" type="text" id="validate" name="validate" maxlength="5" class="w45" value="">&nbsp;<a href="javascript:reloadcode()"><img src="{:zp_url('user/validate/verify','',false,false)}" alt="看不清楚换一张" name="safecode" border="0" align="absbottom" id="safecode"></a>
           {/notempty} 
            <label id="gb_tips"></label>
            <input  class="ui-button" type="submit"  value="发送留言" id="gb_button"  />
            </div>
					</div>
				</form>	
			</div>

			<!-- // ui-message End -->
</div>
{include file="zp_footer" /}
<script type="text/javascript">
var reloadcode = function(){
	$('#safecode').attr('src',"{:zp_url('user/validate/verify','',false,false)}-" + Math.random());
}
	$('#gb_content').focus(function(){
		if($('#gb_content').val() == '请留下您的宝贵意见，最多200个字。'){
			$('#gb_content').val('');
		}
	});
	$('#gb_content').blur(function(){
		if($('#gb_content').val() == ''){
			$('#gb_content').val('请留下您的宝贵意见，最多200个字。');
		}
	});		
   $('#gb_nickname').focus(function(){
		if($('#gb_nickname').val() == '请输入昵称！'){
			$('#gb_nickname').val('');
		}
	});
   	$('#gb_nickname').blur(function(){
		if($('#gb_nickname').val() == ''){
			$('#gb_nickname').val('请输入昵称！');
		}
	});	 
 $("#gb_types li").bind('click',function(e){									
        $("#gb_types li").each(function(){
            $(this).removeClass('selected');
        });
        $(this).addClass('selected');
        $("#gb_type").val($(this).attr('val'));
 });
$("#gb_button").click(function(e) {
	if($('#gb_content').val().length>200){
			$('#gb_tips').html('您输入的留言信息过长，请删减一些！');
  			return false;
		}
		if($('#gb_content').val() == '请留下您的宝贵意见，最多200个字。'){
			$('#gb_content').select();
			$('#gb_tips').html('请输入留言信息！');
  			return false;
		}
		if($('#gb_nickname').val() == '请输入昵称！'){
			$('#gb_nickname').select();
			$('#gb_nickname').html('请输入昵称！');
  			return false;
	}						   
	$("#guestbook").qiresub({
		curobj : $("#gb_button"),
		txt : '数据提交中,请稍后...',
		onsucc : function(result) {
			$.hidediv(result);
			if (parseInt(result['rcode']) > 0) {
			pagegooo("{:zp_url('home/gb/show')}");	
			}
		}
	}).post({
		url :"{:zp_url('home/gb/add')}"
	});
	return false;
});
window.onerror=function(){
	return true;
}
var windowurl='';
var windowuall='';
if(window.location.href.indexOf('show')>0){
  windowurl=window.location.href;
}
var parms='{$page}';
var pid='';
function pagegooo(url){ 
   if(($('#contents div').length > 3)) $("html,body").animate({scrollTop:$("#contents").offset().top - 93},500);
	$("#contents").html('<div class="load">努力加载中……</div>');
	$.get(url, function(data,status) {
	 var value=jQuery('#contents', data).html();
      if(value=='') {
	  value=  '<div class="kong">抱歉，没有找到相关内容！</div>';
	  }  
	 $("#contents").html(value);
	 /********/
	 $("#short-page").html(jQuery('#short-page', data).html())
	 $("#long-page").html(jQuery('#long-page', data).html())
     $(".uipages a").click(function (e){
                        e.preventDefault();
                        var curdata=$(this).attr('data').split('-');
                        parms[curdata[0]]=curdata[1];
                        var url=parseurl(parms);
                        pagegooo(url);
                        return false;
                    });
	});	
}
parms=eval("({'p':'1'})");
function parseurl(rr){
  var url=Root + 'index.php?s=gb-show';
  for(var c in rr){
     if(rr[c]!='0'){
    url=url+"-"+c+"-"+rr[c];
	}
  }
  //url=url+"-ajax";
  return url;
}
  $('.uipages a').click(function (e){
                e.preventDefault();
                $(this).addClass('curr');
                $(this).siblings().removeClass('curr');
                var curdata=$(this).attr('data').split('-');
                parms[curdata[0]]=curdata[1];
                var url=parseurl(parms);
                pagegooo(url);
 }
);
conbread();
</script>
</body>
</html>